package com.wjb.service.impl;


import com.wjb.mapper.OrderMapper;

import com.wjb.model.EbOrder;
import com.wjb.service.OrderService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {
    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<EbOrder> listByPage(Integer page, Integer pageSize) {
        int from = (page - 1) * pageSize;
        return orderMapper.findByPage(from, pageSize);
    }

    @Override
    public Integer getMaxPage(Integer PageSize) {
        return orderMapper.getMaxPage(PageSize);
    }


    @Override
    public EbOrder selectById(Integer eoId) {
        return orderMapper.selectById(eoId);
    }

    @Override
    public int updateById(EbOrder ebOrder) {
        return orderMapper.updateByPrimaryKey(ebOrder);
    }
    public interface OrederService {
        List<EbOrder> listByPage(Integer page, Integer pageSize);
        int save(EbOrder ebOrder);
        int delete(int id);
    }


        @Override
        public  int delete(Integer eoId) {
            return orderMapper.remove(eoId);
        }

    @Override
    public List<EbOrder> listByNamePage(Integer page,Integer pageSize, String eoUserName) {

        int from = (page - 1) * pageSize;
        return orderMapper.listByNamePage(from, pageSize,eoUserName);
    }

}



